<!DOCTYPE html>
<html lang="en">
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<head>
    <!-- META SECTION -->
    <title>基本信息--互联网金融司法诉讼平台</title>
    <link rel="shortcut icon" href="../assets/images/gt_header.png">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />

    <link rel="icon" href="favicon.ico" type="image/x-icon" />
    <!-- END META SECTION -->

    <!-- CSS INCLUDE -->
    <link rel="stylesheet" type="text/css" id="theme" href="css/theme-default.css"/>
    <!-- EOF CSS INCLUDE -->

    <script type="text/javascript">
        window.onload=function() {
            var tableDate = "";
            $.get('/lawyerPersonalInfo',
                    function (result_str) {
                        //http://www.blogjava.net/absolutedo/archive/2009/03/13/259488.html
                        var lawyerInfo = eval("(" + result_str + ")");
                        document.getElementById("topLawyerTelp").innerHTML=lawyerInfo.telp;
                        document.getElementById("leftLawyerTelp").innerHTML=lawyerInfo.telp;
                        document.getElementById("office").value=lawyerInfo.office;
                        document.getElementById("workExp").value=lawyerInfo.workExp;
                        document.getElementById("joinCase").value=lawyerInfo.joinCase;
                        document.getElementById("specializedAreas").value=lawyerInfo.specializedAreas;

                        for(var i = 0; i < lawyerInfo.workPlace.length; i++){
                            var strArr = lawyerInfo.workPlace[i].workscopeAdd.split("_");
                            tableDate +="<tr id='"+(i+1)+"'><td class='text-center'>" + (i+1) + "</td>"
                                    + "<td><input type='text' name='sheng"+(i+1)+"' value='"+strArr[0]+"' id='sheng"+(i+1)+"'/></td>"
                                    + "<td><input type='text' name='shi"+(i+1)+"' value='"+strArr[1]+"' id='shi"+(i+1)+"'/></td>"
                                    + "<td><input type='text' name='xian"+(i+1)+"' value='"+strArr[2]+"' id='xian"+(i+1)+"'/></td>"
                                    + "<td><button class='btn btn-danger btn-rounded btn-sm' onClick='deleteSelect("+(i+1)+")'><span class='fa fa-times'></span></button></td></tr>>"
                        }
                        $("#workScope").html(tableDate);

                    }
            );
        }

        function tableAddRow() {
            var len = $("#workScope tr").length;
            $("#workScope").append("<tr id='"+(len+1)+"'><td class='text-center'>" + (len+1) + "</td>"
                    + "<td><input type='text' name='sheng"+(len+1)+"' value='' id='sheng"+(len+1)+"'/></td>"
                    + "<td><input type='text' name='shi"+(len+1)+"' value='' id='shi"+(len+1)+"'/></td>"
                    + "<td><input type='text' name='xian"+(len+1)+"' value='' id='xian"+(len+1)+"'/></td>"
                    + "<td><button class='btn btn-danger btn-rounded btn-sm' onclick=\'deleteSelect("+(len+1)+")\'><span class='fa fa-times'></span></button></td></tr>");
        }

        function deleteSelect(index) {
            var _len = $("#workScope tr").length;
            $("tr[id='"+index+"']").remove();
            for(var i=index,j=_len;i<j;i++){
                var sheng = $("#sheng"+(i+1)).val();
                var shi = $("#shi"+(i+1)).val();
                var xian = $("#xian"+(i+1)).val();
                $("tr[id=\'"+(i+1)+"\']").replaceWith("<tr id='"+(i)+"'><td class='text-center'>" + (i) + "</td>"
                        + "<td><input type='text' name='sheng"+(i)+"' value='"+sheng+"' id='sheng"+(i)+"'/></td>"
                        + "<td><input type='text' name='shi"+(i)+"' value='"+shi+"' id='shi"+(i)+"'/></td>"
                        + "<td><input type='text' name='xian"+(i)+"' value='"+xian+"' id='xian"+(i)+"'/></td>"
                        + "<td><button class='btn btn-danger btn-rounded btn-sm' onClick='deleteSelect("+(i)+")'><span class='fa fa-times'></span></button></td></tr>>")
            }
        }

        function saveInfo() {
            var LawyerTelp = document.getElementById("topLawyerTelp").innerHTML;
            var office = document.getElementById("office").value;
            var workExp = document.getElementById("workExp").value;
            var joinCase = document.getElementById("joinCase").value;
            var specializedAreas = document.getElementById("specializedAreas").value;
            //var workScope = document.getElementById("workScope").innerHTML;
            var workScope = [];
           // $("#workScope input:eq(8)").val()
            $("#workScope input").each(function(){
                //alert($(this).val());
                workScope.push($(this).val()) ;
            });
            $.post('/lawyerPersonalInfoChange', {LawyerTelp: LawyerTelp,office:office,workExp:workExp,joinCase:joinCase,specializedAreas:specializedAreas,workScope:workScope.join()},function (data){
                if(data!=null)
                    alert("提交成功");
            })
        }

    </script>
</head>
<body>
    <!-- START PAGE CONTAINER -->
    <div class="page-container">

        <!-- START PAGE SIDEBAR -->
        <div class="page-sidebar">
            <!-- START X-NAVIGATION -->
            <ul class="x-navigation">
                <li class="xn-logo">
                    <a href="personalCenter.html" style="background-color: #1d2127;">
                        <img src="../assets/images/logo.png" 
                        style="width: 220px;margin-top: -10px;margin-left: -16px;"></a>
                        <a href="#" class="x-navigation-control"></a>
                    </li>
                    <li class="xn-profile">
                        <a href="#" class="profile-mini" >
                            <img src="assets/images/users/avatar.jpg" alt="John Doe"/>
                        </a>
                        <div class="profile">
                            <div class="profile-image">
                             <a href="../index1.html" target="_blank">   <img src="assets/images/users/avatar.jpg" alt="Jason Zhou"  alt="图片说明" title="点击修改头像" style="margin-top: 10px;"/></a>
                         </div>
                         <div class="profile-data">
                            <div class="profile-data-name" id="leftLawyerTelp" style="margin-top: 5px;"></div>

                        </div>

                    </div>
                </li>
                <li class="xn-title" style="padding-top: 15px;padding-bottom: 15px;">欢迎来到互联网金融司法诉讼平台</li>
                <li >
                    <a href="lawyerCenter.html" style="font-size: 15px;"><span class="fa fa-user"></span> <span class="xn-text">个人中心</span></a>
                </li>
                
                <li class="xn-openable active">
                    <a href="lawyerInfo.html"><span class="fa fa-file-text-o"></span> <span class="xn-text" style="font-size: 15px;">基本信息</span></a>
                    <ul> 
                        <li ><a href="lawyerInfo.html"><span class="fa fa-group"></span> 身份信息</a></li>                            
                        <li class="active"><a href="lawyerworkInfo.html"><span class="fa fa-male"></span> 个人信息</a></li>                                                                  
                    </ul>
                </li>

                <li >
                    <a href="lawyerSec.html"><span class="fa fa-cogs" ></span> <span class="xn-text" style="font-size: 15px;">安全中心</span></a>
                </li>


                <li >
                    <a href="lawyersuit.html"><span class="fa fa-suitcase"></span> <span class="xn-text" style="font-size: 15px;">等待接单</span></a>
                </li>

                <li >
                    <a href="lawyerCases.html"><span class="fa fa-archive"></span> <span class="xn-text" style="font-size: 15px;">我的案件</span></a>
                </li>


            </ul>
            <!-- END X-NAVIGATION -->
        </div>
        <!-- END PAGE SIDEBAR -->

        <!-- PAGE CONTENT -->
        <div class="page-content">

            <!-- START X-NAVIGATION VERTICAL -->
            <ul class="x-navigation x-navigation-horizontal x-navigation-panel">
                <!-- TOGGLE NAVIGATION -->
                <li class="xn-icon-button">
                    <a href="#" class="x-navigation-minimize"><span class="fa fa-dedent"></span></a>
                </li>
                <!-- END TOGGLE NAVIGATION --> 
                <!-- SIGN OUT -->
                <li class="xn-icon-button pull-right">
                    <a href="#" class="mb-control" data-box="#mb-signout"><span class="fa fa-sign-out"></span></a>
                </li>
                <!-- END SIGN OUT -->
                <!-- MESSAGES -->
                <li class="xn-icon-button pull-right">
                    <a href="personalCenter.html" id="topLawyerTelp" style="padding-left: 0px;width: 150px;padding-right: 0px;"></a>

                </li>
                <!-- END MESSAGES -->
                <!-- Hello -->
                <li class="xn-icon-button pull-right">
                    <a style="width: 60px;">您好，</a>

                </li>
                <!-- END Hello -->
            </ul>
            <!-- END X-NAVIGATION VERTICAL -->


            <!-- START BREADCRUMB -->
            <ul class="breadcrumb">
                <li><a href="#">基本信息</a></li>                    
                <li class="active">个人信息</li>
            </ul>
            <!-- END BREADCRUMB --> 

            <!-- PAGE CONTENT WRAPPER -->
            <div class="page-content-wrap">

                <div class="row">
                    <div class="col-md-12">
                        <form class="form-horizontal">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h3 class="panel-title"><strong></strong></h3>
                                </div>
                                <div class="panel-body">
                                  <div class="row" style="height: 15px;background: #1caf9a;width: 1109px;margin-top: -15px;margin-left: -15px;margin-bottom: 20px;"></div>
                                    <p></p>
                                </div>
                                <div class="panel-body">                                                                                         <!-- START RESPONSIVE TABLES -->
                                <div class="row" style=" margin-bottom: 5px;">
                                        <label class="col-md-3 col-xs-12 control-label">工作地点</label><input type="button" id="but" onclick="tableAddRow()" value="增加"/>
                                        <div class="col-md-6 col-xs-12" style="padding-left: 3px;padding-right: 3px;">
                                            <div class="panel panel-default" style=" text-align: center;">
                                                <div class="panel-body panel-body-table">
                                                    <div class="table-responsive">
                                                        <table class="table table-bordered table-striped table-actions">
                                                            <thead>
                                                                <tr>
                                                                    <th width="100" style="text-align: center;">序号</th>
                                                                    <th width="100" style="text-align: center;">省</th>
                                                                    <th width="100" style="text-align: center;">市</th>
                                                                    <th width="100" style="text-align: center;">县/区</th>
                                                                    <th width="120" style="text-align: center;">操作</th>
                                                                </tr>
                                                            </thead>
                                                            <tbody id="workScope">

                                                            </tbody>
                                                        </table>
                                                    </div>                                

                                                </div>

                                            </div>                                                

                                        </div>
                                    </div>
                                    <!-- END RESPONSIVE TABLES -->                                
                                    
                                    <div class="form-group" style="margin-bottom: 20px;">
                                        <label class="col-md-3 col-xs-12 control-label">事务所</label>
                                        <div class="col-md-6 col-xs-12">                                            
                                            <div class="input-group">
                                                <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                                <input id="office" type="text" class="form-control"/>
                                            </div>                                            
                                            <span class="help-block"></span>
                                        </div>
                                    </div>
                                    
                                    
                                    <div class="form-group" style="margin-bottom: 20px;">
                                        <label class="col-md-3 col-xs-12 control-label">工作经验</label>
                                        <div class="col-md-6 col-xs-12">                                            
                                            <textarea id="workExp" class="form-control" rows="5"></textarea>
                                            <span class="help-block"></span>
                                        </div>
                                    </div>

                                    <div class="form-group" style="margin-bottom: 20px;">
                                        <label class="col-md-3 col-xs-12 control-label">参与案件</label>
                                        <div class="col-md-6 col-xs-12">                                            
                                            <textarea id="joinCase" class="form-control" rows="5"></textarea>
                                            <span class="help-block"></span>
                                        </div>
                                    </div>
                                    
                                    <div class="form-group" style="margin-bottom: 20px;">
                                        <label class="col-md-3 col-xs-12 control-label">擅长领域</label>
                                        <div class="col-md-6 col-xs-12">
                                            <div class="input-group">
                                            <span class="input-group-addon"><span class="fa fa-pencil"></span></span>

                                            <input id="specializedAreas" type="text" class="form-control" value=""/>
                                                </div>
                                            <span class="help-block"></span>
                                        </div>
                                    </div>
                                    
                                    

                                    <div class="panel-footer">
                                        <input type="button" id="save" onclick="saveInfo()" value="保存信息"/>
                                        <!--<button class="btn btn-default">清除信息</button>                                    -->
                                        <!--<button class="btn btn-primary pull-right">保存</button>-->
                                    </div>
                                </div>
                            </div>></form>
                            
                        </div>
                    </div>                    
                    
                </div>
                <!-- END PAGE CONTENT WRAPPER -->                                                
            </div>            
            <!-- END PAGE CONTENT -->
        </div>
        <!-- END PAGE CONTAINER -->
        <!-- MESSAGE BOX-->
        <div class="message-box animated fadeIn" data-sound="alert" id="mb-remove-row">
            <div class="mb-container">
                <div class="mb-middle">
                    <div class="mb-title"><span class="fa fa-times"></span> 删除 <strong>数据</strong> ?</div>
                    <div class="mb-content">
                        <p></p>                    
                        <p></p>
                    </div>
                    <div class="mb-footer">
                        <div class="pull-right">
                            <button class="btn btn-success btn-lg mb-control-yes">是</button>
                            <button class="btn btn-default btn-lg mb-control-close">否</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- END MESSAGE BOX-->    

        <!-- MESSAGE BOX-->
        <div class="message-box animated fadeIn" data-sound="alert" id="mb-signout">
            <div class="mb-container">
                <div class="mb-middle">
                    <div class="mb-title"><span class="fa fa-sign-out"></span> 注 <strong>销</strong> ?</div>
                    <div class="mb-content">
                        <p>选择是注销当前用户，选择否将继续停留在该页面。</p>

                    </div>
                    <div class="mb-footer">
                        <div class="pull-right">
                            <a href="../signin.html" class="btn btn-success btn-lg">是</a>
                            <button class="btn btn-default btn-lg mb-control-close">否</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- END MESSAGE BOX-->

        <!-- START PRELOADS -->
        <audio id="audio-alert" src="audio/alert.mp3" preload="auto"></audio>
        <audio id="audio-fail" src="audio/fail.mp3" preload="auto"></audio>
        <!-- END PRELOADS -->

        <!-- START SCRIPTS -->
        <!-- START PLUGINS -->
       <script type="text/javascript" src="js/plugins/jquery/jquery.min.js"></script>

        <script type="text/javascript" src="js/plugins/jquery/jquery-ui.min.js"></script>
        <script type="text/javascript" src="js/plugins/bootstrap/bootstrap.min.js"></script>
        <!-- END PLUGINS -->
        
        <!-- THIS PAGE PLUGINS -->
        
        
        <script type="text/javascript" src="js/plugins/bootstrap/bootstrap-datepicker.js"></script>
        <script type="text/javascript" src="js/plugins/bootstrap/bootstrap-file-input.js"></script>
        <script type="text/javascript" src="js/plugins/bootstrap/bootstrap-select.js"></script>
        <script type="text/javascript" src="js/plugins/tagsinput/jquery.tagsinput.min.js"></script>
        <!-- END THIS PAGE PLUGINS -->

        <!-- START THIS PAGE PLUGINS-->        
        <script type='text/javascript' src='js/plugins/icheck/icheck.min.js'></script>
        <script type="text/javascript" src="js/plugins/mcustomscrollbar/jquery.mCustomScrollbar.min.js"></script>
        
        <script type="text/javascript" src="js/demo_tables.js"></script>
        <!-- END THIS PAGE PLUGINS-->       
        
        <!-- START TEMPLATE -->
        <script type="text/javascript" src="js/settings.js"></script>

        <script type="text/javascript" src="js/plugins.js"></script>
        <script type="text/javascript" src="js/actions.js"></script>
        <!-- END TEMPLATE -->
        <!-- END SCRIPTS -->                   
    </body>
    </html>





